<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class ddbb{
    
    protected $con;
    
    public function __construct($host, $db, $user, $pass) {
        $this->con = mysqli_connect($host, $user, $pass) OR die ("No se puede conectar");
        if(mysqli_select_db($this->con,$db)){}
        else{echo"ERROR: CAN'T CONNECT TO THE DATABASE PLEASE TRY LATER OR CONTACT TO ADMINISTRATOR<br>";}
    }
    
    protected function desconectar(){
        mysqli_close($this->con);
    }
}

?>
